package com.nj.liandi.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.nj.liandi.common.to.mq.SeckillOrderTo;
import com.nj.liandi.common.utils.PageUtils;
import com.nj.liandi.gulimall.order.entity.OrderEntity;
import com.nj.liandi.gulimall.order.vo.*;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author MZJ
 * @email MZJ@gmail.com
 * @date 2021-08-19 16:55:49
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /*
     * description: 订单确认页需要返回的数据 
     * version: 1.0 
     * date: 2021/10/29 16:07 
     * author: maizj 
     * param: []
     * @return com.nj.liandi.gulimall.order.vo.OrderConfirmVo
     * */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /*
     * description: 下单操作 
     * version: 1.0 
     * date: 2021/10/29 16:07 
     * author: maizj 
     * param: [vo]
     * @return com.nj.liandi.gulimall.order.vo.SubmitOrderResponseVo
     * */
    SubmitOrderResponseVo submitOrder(OrderSubmitVo vo);

    /** description: 返回订单状态
     * version: 1.0 
     * date: 2021/11/4 10:34
     * */
    OrderEntity getOrderByOrderSn(String orderSn);

    /** description: 定时关闭订单
     * version: 1.0 
     * date: 2021/11/4 14:38
     * */
    void closeOrder(OrderEntity orderEntity);

    /** description: 获取当前的支付信息
     * version: 1.0 
     * date: 2021/11/8 14:23
     * */
    PayVo getOrderPay(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);

    /** description: 处理支付宝异步通知回调结果
     * version: 1.0 
     * date: 2021/11/9 13:33
     * */
    String handlePayResult(PayAsyncVo vo);

    /** description: 创建秒杀订单
     * version: 1.0 
     * date: 2021/11/12 9:21
     * */
    void createSeckillOrder(SeckillOrderTo seckillOrderTo);
}

